package cn.hackcloud.annotation.tx;

import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class UserDao {
	@Autowired
	JdbcTemplate jdbcTemplate;

	public void insert() {
		String sql = "INSERT INTO USER(NAME,age) VALUE (?,?)";
		String userName = UUID.randomUUID().toString().substring(0, 5);
		jdbcTemplate.update(sql, userName, 20);
	}
}
